fix: Improve request count tracking by using fresh contexts#27
Conversation
WalkthroughThe server code was modified to use a fresh background context with a 5-second timeout instead of the original request context when incrementing per-endpoint proxy request counts. This change applies to both HTTP and WebSocket success paths. The new implementation creates a metrics context (metricsCtx), invokes IncrementRequestCount with it, handles any resulting errors, and then cancels the context. Minor formatting updates and explanatory comments were also added. No changes were made to exported or public entity signatures. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit